/* eslint-disable */
export default {
  data() {
    return {
      // 资产数据
      assetData:[
        {
          contractNo: '0001201911025861',
          company: 'XXX公司',
          userEmployer: 'XX领用人1',
          usertel: '15000012345',
          userName: 'XX使用人1',
          administrator: 'XX管理人1',
          deadline: '3年',
          assetStatus: '待归还',
        },
        {
          contractNo: '0001201911025031',
          company: 'XXX公司',
          userEmployer: 'XX领用人2',
          usertel: '15000012345',
          userName: 'XX使用人2',
          administrator: 'XX管理人2',
          deadline: '3年',
          assetStatus: '待归还',
        },
        {
          contractNo: '0001201911025031',
          company: 'XXX公司',
          userEmployer: 'XX领用人3',
          usertel: '15000012345',
          userName: 'XX使用人3',
          administrator: 'XX管理人3',
          deadline: '5年',
          assetStatus: '待归还',
        },
        {
          contractNo: '0001201911024234',
          company: 'XXX公司',
          userEmployer: 'XX领用人4',
          usertel: '15000012345',
          userName: 'XX使用人4',
          administrator: 'XX管理人4',
          deadline: '1年',
          assetStatus: '待归还',
        },
        {
          contractNo: '0001201911027165',
          company: 'XXX公司',
          userEmployer: 'XX领用人5',
          usertel: '15000012345',
          userName: 'XX使用人5',
          administrator: 'XX管理人5',
          deadline: '3年',
          assetStatus: '待归还',
        },
        {
          contractNo: '0001201911027439',
          company: 'XXX公司',
          userEmployer: 'XX领用人6',
          usertel: '15000012345',
          userName: 'XX使用人6',
          administrator: 'XX管理人6',
          deadline: '5年',
          assetStatus: '待归还',
        },
      ],

      // 资产图片上传
      dialogImageUrl: '',
      dialogVisible: false,
      disabled: false,

      // 新增资产弹窗
      dialogAssetAdd:{
        title: '资产审核',
        status: false,
      },

      // 新增资产表单数据
      assetAddFrom:{
        assetName: 'XX资产名称',
        assetType: '办公',
        inboundDate: '2019-11-01',
        assetNorm: '型号:XXX',
        assetNum: '2',
        includesTax: true,
        supplier: 'XX供应商',
        contractNo: '0001201911027439',
        purchaseUnit: 'XX单位',
        fixedAssets: false,
        assetUseYear: '2年',
        taxIncludedPrice: '200', // 含税价
        excludingTaxPrice: '', // 不含税价
      },

      // 新增资产表单验证
      assetAddRules: {
        assetName: [
          { required: true, message: '请输入资产名称', trigger: 'blur' },
        ],
        assetType: [
          { required: true, message: '请选择资产类型', trigger: 'change' },
        ],
      },

      // 资产归还表单
      uerFrom:{
        assetId: '',
        use: 0,
      },

      // 资产归还
      dialogAssetUse:{
        title: '资产归还',
        status: false,
      },
    }
  },
  mounted() {

  },
  methods: {
    // 资产弹窗
    dialogAsset(row){
      // this.assetAddFrom = row
      this.dialogAssetAdd.status = true
    },

    // 资产照片上传
    uploadFuc(){
      this.$message({
        type: 'success',
        message: '上传失败!'
      })
    },
    successFuc(){
      this.$message({
        type: 'success',
        message: '上传成功!'
      })
    },
    handleRemove(file) {
      console.log(file);
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },

    // 资产归还弹窗
    dialogUse(row){
      this.uerFrom.assetId = row.contractNo
      this.uerFrom.use = '0',
      this.dialogAssetUse.status = true
    },

    // 资产归还
    assetUse(){
      this.$message({
        type: 'success',
        message: '归还成功!'
      })
      this.dialogAssetUse.status = false
    }
  }
}